// 清单表编辑视图自定义js保存参数
// pov比较符值类型
export enum ComparatorType {
  // 等于
  EQUAL = 'EQUAL',
  // 成员及后代
  IDESCENDANT = 'IDESCENDANT',
  // 成员及子代
  ICHILDREN = 'ICHILDREN',
  // 成员及末级节点
  IBASE = 'IBASE',
  // 包含
  LIKE = 'LIKE',
  // 在范围内
  BETWEEN_AND = 'BETWEEN_AND',
  // 不在范围内
  NOT_IN_BETWEEN_AND = 'NOT_IN_BETWEEN_AND',
  // 在列表中
  IN_LIST = 'IN_LIST',
  // 不在列表中
  NOT_IN_LIST = 'NOT_IN_LIST',
}

/**
 * 统计方式
 */
export type IStatisticalWay = 'SUM' | 'AVG' | 'MAX' | 'MIN' | 'COUNT_NOT_NULL' | 'COUNT_IS_NULL';

export interface PageList {
  customColumnWidth: number;
  id: string;
  listTableId: string;
  datatableAlias: string;
  ltdId: string;
  datatableColumn: string;
  columnType: string;
  isCustom: number;
  isDisplay?: boolean;
  hidePageField?: boolean;
  customFormula: any;
  alias: string;
  sort: number;
  description: { [key: string]: string };
  valueType: number;
  isGlobal: number;
  valueTypeScript: string;
  valueTypeMap: ValueTypeMap;
  enableAccessUnit: number;
  accessControlUnit: string;
  isRole: boolean;
  rsMapping: string;
  rsDimension: string;
  statusSort: any;
  isColFrozen?: boolean;
  cookiesActive?: number; // 0-false ,1-true
  isHide?: number; // 0-false ,1-true
  defaultSelectFirstOne?: boolean | null;
  comparator?: ComparatorType | null;
  readOnly?: boolean | null;
  errorList: any[];
  warningList: any[];
  // 用于区分使用态时povList 中数据哪些是参数列表
  partType?: 'povList' | 'variableList';
  // 作为统计字段
  asStatisticalField?: boolean;
  // 默认统计方式
  statisticalWay?: IStatisticalWay;
}

export interface ValueTypeMap {
  valueType: number;
  valueKey: string;
  treeView: boolean;
  dimensionDisplay: number;
  multiLevel: string;
  defaultValue: any;
  length: any;
  maxLen: any;
  digitLen: any;
  minimun: any;
  maximun: any;
  displayDigitLen: any;
  minEqual: any;
  maxEqual: any;
  percentage: any;
  instruction: any;
  dimensionName: any;
  selectedMulti: any;
  multipleChoiceLimit: any;
  list: any;
  valueField: any;
  thousandthSymbol: any;
  enableDimensionExpression: any;
  decimalDisplayLength: any;
  functionCode: any;
  selectMulti: any;
  elementDetail?: any;
  rsName?: string;
  rsElementDetail?: any;
  rsMapping?: string;
  rsRole?: string;
  rsRoleGroup?: string;
  multipleLevelInfo?: any[] | null;
  defaultValueShow?: string[];
  defaultValueType?: any;
  fixedFilterCondition?: string;
  errorList?: any[];
  warningList?: any[];
}
